//
//  ViewController.m
//  moBoLi
//
//  Created by wanglei on 17/1/4.
//  Copyright © 2017年 wanglei. All rights reserved.
//

#import "ViewController.h"
#import <Accelerate/Accelerate.h>

@interface ViewController ()
@property(nonatomic,strong)UIImageView *imageView;
@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self functionOne];
    [self functionTwo];
}



// 使用库Accelerate.Framework
- (void)functionTwo{
    
    UIImageView  *imageView=[[UIImageView alloc]initWithFrame:CGRectMake(30, 10, 350, 300)];
    imageView.contentMode=UIViewContentModeScaleAspectFill;
    UIImage *image = [UIImage imageNamed:@"1"];
    imageView.image=[UIImage boxblurImage:image withBlurNumber:0.5];
    imageView.clipsToBounds=YES;
    [self.view addSubview:imageView];
    
}



// 使用库CoreImage.framework,图片周边有白边,不太好看
- (void)functionOne{
    
    UIImage *image = [UIImage imageNamed:@"1"];
    self.imageView = [[UIImageView alloc]initWithFrame:CGRectMake(30, 350, 350, 300)];
    _imageView.contentMode = UIViewContentModeScaleAspectFill;
    // withBlurNumber的值越大,毛玻璃就越毛
    _imageView.image = [UIImage coreBlurImage:image withBlurNumber:2];;
    [self.view addSubview:_imageView];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
